﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;
using Chowpoo.Sql;

namespace CourseSystem.Core.Entities
{
    [Table(Name = "ImgResources")]
    public class ImgResourcesInfo :ColumnKey, IDetach
    {
        public ImgResourcesInfo()
        {
            Detach();
        }
        #region Model
        private string _title = "";
        private byte _type = 0;
        private string _filename = "";
        private int _hits = 0;
        private string _uploader = "";
        private DateTime _uploaddate = DateTime.Now;
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("图片标题")]
        [Required(ErrorMessage="必须填写")]
        public string Title
        {
            set { _title = value; }
            get { return _title; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        public byte Type
        {
            set { _type = value; }
            get { return _type; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("图片")]
        public string FileName
        {
            set { _filename = value; }
            get { return _filename; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        public int Hits
        {
            set { _hits = value; }
            get { return _hits; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("作者")]
        public string Author
        {
            set { _uploader = value; }
            get { return _uploader; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        public DateTime UploadDate
        {
            set { _uploaddate = value; }
            get { return _uploaddate; }
        }

        /// <summary>
        /// 上传者ID
        /// </summary>
        [Column]
        public int UploaderId
        {
            get;
            set;
        }
        /// <summary>
        /// 1学生2教师
        /// </summary>
       [Column]
        public byte UploaderType
        {
            get;
            set;
        }

        #endregion Model

        public void Detach()
        {

        }
    }
}
